def findComplement(num):
    i = 1
    while i <= num:
        i = i << 1
        print bin(i)
    # print bin(i-1), bin(i)
    return (i - 1) ^ num


print findComplement(5)
